﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace SZJT.Framework.Core
{
    public abstract class MessageBase
    {
        private IList<XmlDataElement> _elements = new List<XmlDataElement>();

        public string TaskGuid
        {
            get;
            set;
        }

        public string DataGuid
        {
            get;
            set;
        }

        public string DataType
        {
            get;
            set;
        }

        public IList<XmlDataElement> Elements
        {
            get
            {
                return _elements;
            }
            set
            {
                _elements = value;
            }
        }

        public string XmlTransformElementsRootName
        {
            get;
            set;
        }

        public XmlDataElement GetElement(string elementName)
        {
            foreach (XmlDataElement element in Elements)
            {
                if (element.Name == elementName)
                {
                    return element;
                }
            }

            return null;
        }
    }
}
